<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>响应式布局-媒体查询</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            height: 100%;
        }
        body{
            background: yellow;
        }
        @media screen and (min-width:1000px){
        body{
            background: yellow;
        }
    }
        /* 屏幕宽度大于1000px背景为黄色 */
    @media screen and (max-width:1000px) and (min-width:500px){
        body{
            background: red;
        }
    }
    /* 屏幕宽度小于1000px大于500px背景为红色 */
    @media screen and (max-width:500px){
        body{
            background: green;
        }
    }
    /* 屏幕宽度小于500px背景为绿色 */
    </style>
</head>
<body>
    
</body>
</html>